package org.dev.vlp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 动态表
 * @TableName vlp_moment
 */
@TableName(value ="vlp_moment")
@Data
public class Moment implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long momentId;

    /**
     * 发送者id
     */
    private Long userId;

    /**
     * 类型（TEXT：纯文本，IMAGE：图片，VIDEO：视频）
     */
    private String type;

    /**
     * 文本内容
     */
    private String content;

    /**
     * 点赞数量
     */
    private Integer likeCount;

    /**
     * 评论数量
     */
    private Integer commentCount;

    /**
     * 转发数量
     */
    private Integer repostCount;

    /**
     * 分享数量
     */
    private Integer shareCount;

    /**
     * 查看次数
     */
    private Integer viewCount;

    /**
     * 转发的动态id
     */
    private Long repostMomentId;

    /**
     * 状态（0：正常，1：已删除）
     */
    private Integer isDeleted;

    /**
     * 创建时间
     */
    private Date gmtCreateTime;

    /**
     * 更新时间
     */
    private Date gmtModified;

    private Integer communityId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Moment other = (Moment) that;
        return (this.getMomentId() == null ? other.getMomentId() == null : this.getMomentId().equals(other.getMomentId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getLikeCount() == null ? other.getLikeCount() == null : this.getLikeCount().equals(other.getLikeCount()))
            && (this.getCommentCount() == null ? other.getCommentCount() == null : this.getCommentCount().equals(other.getCommentCount()))
            && (this.getRepostCount() == null ? other.getRepostCount() == null : this.getRepostCount().equals(other.getRepostCount()))
            && (this.getShareCount() == null ? other.getShareCount() == null : this.getShareCount().equals(other.getShareCount()))
            && (this.getViewCount() == null ? other.getViewCount() == null : this.getViewCount().equals(other.getViewCount()))
            && (this.getRepostMomentId() == null ? other.getRepostMomentId() == null : this.getRepostMomentId().equals(other.getRepostMomentId()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getGmtCreateTime() == null ? other.getGmtCreateTime() == null : this.getGmtCreateTime().equals(other.getGmtCreateTime()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMomentId() == null) ? 0 : getMomentId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getLikeCount() == null) ? 0 : getLikeCount().hashCode());
        result = prime * result + ((getCommentCount() == null) ? 0 : getCommentCount().hashCode());
        result = prime * result + ((getRepostCount() == null) ? 0 : getRepostCount().hashCode());
        result = prime * result + ((getShareCount() == null) ? 0 : getShareCount().hashCode());
        result = prime * result + ((getViewCount() == null) ? 0 : getViewCount().hashCode());
        result = prime * result + ((getRepostMomentId() == null) ? 0 : getRepostMomentId().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getGmtCreateTime() == null) ? 0 : getGmtCreateTime().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", momentId=").append(momentId);
        sb.append(", userId=").append(userId);
        sb.append(", type=").append(type);
        sb.append(", content=").append(content);
        sb.append(", likeCount=").append(likeCount);
        sb.append(", commentCount=").append(commentCount);
        sb.append(", repostCount=").append(repostCount);
        sb.append(", shareCount=").append(shareCount);
        sb.append(", viewCount=").append(viewCount);
        sb.append(", repostMomentId=").append(repostMomentId);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", gmtCreateTime=").append(gmtCreateTime);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}